/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="bank")
public class Bank implements Serializable {
	public Bank() {
	}
	
	private int id;
	
	private String name;
	
	private String code;
	
	private Byte sort;
	
	private Byte isDisabled;
	
	private java.util.Set bankcard = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_BANK_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_BANK_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 银行名称
	 */
	public void setName(String value) {
		this.name = value;
	}
	
	/**
	 * 银行名称
	 */
	@Column(name="name", nullable=true, length=255)	
	public String getName() {
		return name;
	}
	
	/**
	 * 银行编码
	 */
	public void setCode(String value) {
		this.code = value;
	}
	
	/**
	 * 银行编码
	 */
	@Column(name="code", nullable=true, length=255)	
	public String getCode() {
		return code;
	}
	
	/**
	 * 排序
	 */
	public void setSort(byte value) {
		setSort(new Byte(value));
	}
	
	/**
	 * 排序
	 */
	public void setSort(Byte value) {
		this.sort = value;
	}
	
	/**
	 * 排序
	 */
	@Column(name="sort", nullable=true)	
	public Byte getSort() {
		return sort;
	}
	
	/**
	 * 是否禁用
	 */
	public void setIsDisabled(byte value) {
		setIsDisabled(new Byte(value));
	}
	
	/**
	 * 是否禁用
	 */
	public void setIsDisabled(Byte value) {
		this.isDisabled = value;
	}
	
	/**
	 * 是否禁用
	 */
	@Column(name="isDisabled", nullable=true)	
	public Byte getIsDisabled() {
		return isDisabled;
	}
	
	public void setBankcard(java.util.Set value) {
		this.bankcard = value;
	}
	
	@OneToMany(mappedBy="bank", targetEntity=cn.imvc.app.entities.Bankcard.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getBankcard() {
		return bankcard;
	}
	
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("Bank[ ");
			sb.append("Id=").append(getId()).append(" ");
			sb.append("Name=").append(getName()).append(" ");
			sb.append("Code=").append(getCode()).append(" ");
			sb.append("Sort=").append(getSort()).append(" ");
			sb.append("IsDisabled=").append(getIsDisabled()).append(" ");
			sb.append("Bankcard.size=").append(getBankcard().size()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
